Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
.next
.git
.env
Dockerfile
docker-compose.yml
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#Creates a layer from node:alpine image.
# FROM chub.cloud.gov.in/mit6c0-ogd/node-16:nic_server
FROM node:alpine


# RUN echo 'deb http://deb.debian.org/debian stretch main' >> apk update \
# apk add curl git nano wget screen vim

#Creates directories
RUN mkdir -p /usr/src/app

# env

#Sets the working directory for any RUN, CMD, ENTRYPOINT, COPY, and ADD commands
WORKDIR /usr/src/app

##Copy new files or directories into the filesystem of the container
COPY . /usr/src/app

#Execute commands in a new layer on top of the current image and commit the results
RUN npm install --
# RUN npm run build

# Expose port 3000 to host
EXPOSE 3000

#Allows you to configure a container that will run as an executable
CMD npm run build && npm start
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
services:

next_app:
build:
context: .
dockerfile: Dockerfile
container_name: next-js-app
env_file:
- .env.local
ports:
- 3000:3000
# stdin_open: true
# restart: unless-stopped

Loading