attempted docker file
This commit is contained in:
-27
@@ -1,27 +0,0 @@
|
|||||||
# IMPORTANT: run from root of monolithic repo
|
|
||||||
|
|
||||||
FROM ubuntu
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY ./package.json .
|
|
||||||
|
|
||||||
COPY ./packages/api/package.json ./packages/api/
|
|
||||||
|
|
||||||
# copy the core private package
|
|
||||||
COPY ./packages/core ./packages/core
|
|
||||||
COPY ./packages/core/package.json ./packages/core/
|
|
||||||
# run and compile the core package
|
|
||||||
WORKDIR /app/packages/core
|
|
||||||
# todo: might not need this and just do from level higher
|
|
||||||
RUN yarn install
|
|
||||||
|
|
||||||
WORKDIR /app/packages/api
|
|
||||||
|
|
||||||
# copy all of the source code
|
|
||||||
COPY ./dist ./packages/api
|
|
||||||
RUN yarn install --production
|
|
||||||
|
|
||||||
# steps
|
|
||||||
# 1. compile all dependencies
|
|
||||||
# add the
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
node_modules/
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# This file specifies files that are *not* uploaded to Google Cloud
|
||||||
|
# using gcloud. It follows the same syntax as .gitignore, with the addition of
|
||||||
|
# "#!include" directives (which insert the entries of the given .gitignore-style
|
||||||
|
# file at that point).
|
||||||
|
#
|
||||||
|
# For more information, run:
|
||||||
|
# $ gcloud topic gcloudignore
|
||||||
|
#
|
||||||
|
.gcloudignore
|
||||||
|
# If you would like to upload your .git directory, .gitignore file or files
|
||||||
|
# from your .gitignore file, remove the corresponding line
|
||||||
|
# below:
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
|
||||||
|
# Node.js dependencies:
|
||||||
|
node_modules/
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
# IMPORTANT: run from root of monolithic repo
|
||||||
|
FROM ubuntu
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# The global package.json only contains build dependencies
|
||||||
|
COPY ./package.json .
|
||||||
|
COPY ./yarn.lock .
|
||||||
|
|
||||||
|
# copy the source coded needed for all dependencies
|
||||||
|
COPY ./packages/core packages/core
|
||||||
|
COPY ./packages/api packages/api
|
||||||
|
|
||||||
|
# run and compile the core package
|
||||||
|
WORKDIR /app/packages/core
|
||||||
|
# todo: might not need this and just do from level higher
|
||||||
|
RUN yarn install
|
||||||
|
|
||||||
|
WORKDIR /app/packages/api
|
||||||
|
RUN yarn install --production
|
||||||
|
RUN yarn build
|
||||||
|
|
||||||
|
CMD ["yarn", "start"]
|
||||||
|
|
||||||
|
|
||||||
|
# docker build -t talksik/nirvana-api:1.0
|
||||||
|
# docker run -p 5000:8080 -d
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
runtime: nodejs14
|
||||||
@@ -5,6 +5,8 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "NODE_ENV=development nodemon",
|
"dev": "NODE_ENV=development nodemon",
|
||||||
|
"start": "node dist/index.js",
|
||||||
|
"gcp-build": "tsc -p .",
|
||||||
"start:dev": "ts-node index.ts",
|
"start:dev": "ts-node index.ts",
|
||||||
"production": "NODE_ENV=production nodemon"
|
"production": "NODE_ENV=production nodemon"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user