-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: gains PROD version of
Dockerfile
(#16)
* rename Dockerfile.dev to Dockerfile * use nginx server for prod * update Dockerfile name and ports
- Loading branch information
Showing
4 changed files
with
57 additions
and
30 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Build Stage | ||
FROM node:18-alpine AS build | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Copy package.json and package-lock.json to the working directory | ||
COPY package*.json ./ | ||
|
||
# Install the dependencies | ||
RUN npm install | ||
|
||
# Copy necessary configurations to the working directory | ||
COPY postcss.config.cjs ./ | ||
COPY svelte.config.js ./ | ||
COPY tailwind.config.ts ./ | ||
COPY tsconfig.json ./ | ||
COPY vite.config.ts ./ | ||
|
||
# Copy the source code to the working directory | ||
COPY src ./src | ||
COPY static ./static | ||
# COPY .svelte-kit ./.svelte-kit | ||
|
||
# Build the application | ||
RUN npm run build | ||
|
||
# Production Stage | ||
FROM nginx:alpine | ||
|
||
# Copy the built files from the build stage | ||
COPY --from=build /app/build /usr/share/nginx/html | ||
|
||
# Copy the nginx configuration file | ||
COPY nginx.conf /etc/nginx/conf.d/default.conf | ||
|
||
# Expose the port on which the application will run | ||
EXPOSE 8080 | ||
|
||
# Start nginx server | ||
CMD ["nginx", "-g", "daemon off;"] |
This file was deleted.
Oops, something went wrong.
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
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,14 @@ | ||
server { | ||
listen 8080; | ||
server_name localhost; | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
|
||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
root /usr/share/nginx/html; | ||
} | ||
} |