Skip to content
This repository was archived by the owner on May 1, 2021. It is now read-only.

Commit c00452a

Browse files
committed
feat(docker): dockerize project
Everything now has the ability to run under docker, although "everything" isnt that much yet
1 parent 40cf713 commit c00452a

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
.github
3+
.git
4+
dist
5+
.gitignore
6+
*.md
7+
LICENSE

Dockerfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Indicate that we want to use node 14.7.0 alpine.
2+
#? Alpine is simply a lighter image, although it is not as comprehensive as the normal image
3+
FROM node:14.7-alpine
4+
5+
6+
# Copy the package.json and yarn.lock files to the /tmp directory, in order to install dependencies
7+
#? This is done to improve
8+
COPY package.json /tmp
9+
COPY yarn.lock /tmp
10+
11+
# Change into the /tmp directory
12+
WORKDIR /tmp
13+
14+
# Install all the dependencies
15+
RUN yarn
16+
17+
# Make the directory the backend will reside in and copy the node modules into it
18+
RUN mkdir -p /app && cp -a /tmp/node_modules /app/ && cp package.json /app
19+
20+
# Change to the directory and add the backend's source files
21+
WORKDIR /app
22+
COPY . .
23+
24+
RUN yarn run build
25+
26+
RUN rm -r ./src
27+
28+
EXPOSE 80
29+
EXPOSE 443
30+
31+
# Start the backend in production mode
32+
CMD [ "yarn", "start" ]

docker-compose.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: "3.8"
2+
3+
services:
4+
backend:
5+
build:
6+
context: "."
7+
dockerfile: "./Dockerfile"
8+
ports:
9+
- "80:80"
10+
- "443:443"
11+
12+
env_file:
13+
- .env

0 commit comments

Comments
 (0)