-
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.
Initial Podman Container implementation
Added a containerfile for building a podman server container. Added a dockerignore for the files not needed for running the server. Added an install script for installing all podman containers.
- Loading branch information
Showing
4 changed files
with
57 additions
and
0 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,12 @@ | ||
# Change this as necessary for your own project(s) | ||
Containerfile* | ||
README.md | ||
node_modules | ||
*/node_modules | ||
*.log | ||
.dockerignore | ||
.env* | ||
mysqldata* | ||
.vscode | ||
.github | ||
.git |
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,11 @@ | ||
FROM mysql/mysql-server:latest as base | ||
|
||
VOLUME ./mysqldata /var/lib/mysql | ||
|
||
ENV MYSQL_ROOT_PASSWORD=root_pw | ||
ENV MYSQL_ROOT_HOST=% | ||
ENV MYSQL_USER=infodb_user | ||
ENV MYSQL_PASSWORD=infodb_pw_123 | ||
ENV MYSQL_DATABASE=infodb | ||
|
||
EXPOSE 3306 |
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,27 @@ | ||
FROM node:alpine as base | ||
|
||
WORKDIR /usr/src/app | ||
|
||
# Copy in package.json and package-lock.json | ||
COPY --chown=1001:1001 package*.json ./ | ||
|
||
# Install dependencies and devDependencies | ||
RUN npm ci --omit=dev | ||
|
||
# Copy in source code and other assets | ||
COPY --chown=1001:1001 . . | ||
|
||
# Compile the source TS into JS files | ||
# RUN npm run build:ts | ||
|
||
# Configure fastify behaviour, and NODE_ENV | ||
ENV NODE_ENV=production | ||
ENV JWT_ACCESS_SECRET=SECRET123 | ||
ENV JWT_REFRESH_SECRET=ANOTHER_SECRET123 | ||
ENV DATABASE_URL=mysql://infodb_user:infodb_pw_123@localhost:3306/infodb | ||
|
||
EXPOSE 3000 | ||
|
||
RUN npx prisma generate | ||
|
||
CMD ["npm", "run", "start:migrate"] |
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,7 @@ | ||
podman pod create --name scheduler-demo-pod --publish=3306:3306,3000:3000 && | ||
podman build . -f ./Containerfile.server -t scheduler-demo-server && | ||
podman build . -f ./Containerfile.database -t scheduler-demo-db && | ||
|
||
podman run -dit --pod=scheduler-demo-pod --name=scheduler-demo-db-1 scheduler-demo-db:latest && | ||
podman run -dit --pod=scheduler-demo-pod --name=scheduler-demo-server-1 scheduler-demo-server:latest | ||
|