Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Dockerfile and docker-compose to run Coup #72

Merged
merged 5 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
npm-debug.log
Dockerfile*
.dockerignore
.git
.gitignore
treason*.log*
.yarnrc
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM node:lts-alpine as builder

# Install dependencies
RUN apk add --no-cache git
ScribblerCoder marked this conversation as resolved.
Show resolved Hide resolved

# Initialize the working directory
WORKDIR /app

# Copy package.json
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy the source code
COPY . .

# Prune to production dependencies
RUN npm prune --production
ScribblerCoder marked this conversation as resolved.
Show resolved Hide resolved


# Final image
FROM node:lts-alpine
ScribblerCoder marked this conversation as resolved.
Show resolved Hide resolved

WORKDIR /app

COPY --from=builder /app ./

# Expose the port and start the application
EXPOSE 8080
CMD ["npm", "start"]
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: '3'

services:
treason:
build:
context: .
dockerfile: Dockerfile
ports:
- "8080:8080"