-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docker: deployment script generalised to support 3rd party separate d…
…eployments
- Loading branch information
Showing
3 changed files
with
43 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,33 @@ | ||
FROM node:16 As development | ||
WORKDIR /usr/src/app | ||
COPY package*.json ./ | ||
COPY *.lock ./ | ||
FROM node:16 AS builder | ||
|
||
# Create app directory | ||
WORKDIR /app | ||
|
||
# A wildcard is used to ensure both package.json AND package-lock.json are copied | ||
COPY package.json ./ | ||
COPY yarn.lock ./ | ||
|
||
# Install app dependencies | ||
RUN yarn install | ||
COPY . . | ||
RUN yarn run build | ||
COPY dist ./dist | ||
|
||
FROM node:16 | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /app/node_modules ./node_modules | ||
COPY --from=builder /app/package.json ./ | ||
COPY --from=builder /app/yarn.lock ./ | ||
COPY --from=builder /app/dist ./dist | ||
|
||
# create gen directories to store files | ||
RUN mkdir -p ./gen/images ./gen/xlsx ./gen/xml ./gen/zip/extracted ./gen/zip/uploaded | ||
|
||
RUN apt-get update -y \ | ||
&& apt-get install python3-pip -y \ | ||
&& pip3 install pyxform==1.10.1 | ||
|
||
CMD ["node", "dist/main"] | ||
EXPOSE 3000 | ||
CMD [ "yarn", "run", "start:prod" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: '3.7' | ||
|
||
services: | ||
main: | ||
container_name: quml2xform | ||
image: samagragovernance/quml2xform:latest | ||
ports: | ||
- ${PORT}:3000 | ||
env_file: | ||
- .env | ||
volumes: | ||
- gen:/app/gen | ||
|
||
volumes: | ||
gen: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters