Skip to content

Commit 389f228

Browse files
Merge pull request #204 from CivicDataLab/203-add-dockerfile
2 parents b060ae0 + fb348c7 commit 389f228

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
.next
3+
.git
4+
.env
5+
Dockerfile
6+
docker-compose.yml

Dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#Creates a layer from node:alpine image.
2+
# FROM chub.cloud.gov.in/mit6c0-ogd/node-16:nic_server
3+
FROM node:alpine
4+
5+
6+
# RUN echo 'deb http://deb.debian.org/debian stretch main' >> apk update \
7+
# apk add curl git nano wget screen vim
8+
9+
#Creates directories
10+
RUN mkdir -p /usr/src/app
11+
12+
# env
13+
14+
#Sets the working directory for any RUN, CMD, ENTRYPOINT, COPY, and ADD commands
15+
WORKDIR /usr/src/app
16+
17+
##Copy new files or directories into the filesystem of the container
18+
COPY . /usr/src/app
19+
20+
#Execute commands in a new layer on top of the current image and commit the results
21+
RUN npm install --
22+
# RUN npm run build
23+
24+
# Expose port 3000 to host
25+
EXPOSE 3000
26+
27+
#Allows you to configure a container that will run as an executable
28+
CMD npm run build && npm start

docker-compose.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
services:
2+
3+
next_app:
4+
build:
5+
context: .
6+
dockerfile: Dockerfile
7+
container_name: next-js-app
8+
env_file:
9+
- .env.local
10+
ports:
11+
- 3000:3000
12+
# stdin_open: true
13+
# restart: unless-stopped
14+

0 commit comments

Comments
 (0)