fixed dockerfile. changed package manager to yarn
This commit is contained in:
parent
252548aff8
commit
622c12bc8d
@ -1 +1,4 @@
|
|||||||
node_modules
|
node_modules
|
||||||
|
.svelte-kit
|
||||||
|
build
|
||||||
|
.env
|
34
Dockerfile
34
Dockerfile
@ -1,28 +1,22 @@
|
|||||||
#Dockerfile
|
FROM node:18-alpine AS builder
|
||||||
|
RUN mkdir /app
|
||||||
# Use this image as the platform to build the app
|
|
||||||
FROM node:18-alpine AS external-website
|
|
||||||
|
|
||||||
# A small line inside the image to show who made it
|
|
||||||
LABEL Developers="Christian Rannes"
|
|
||||||
|
|
||||||
# The WORKDIR instruction sets the working directory for everything that will happen next
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy all local files into the image
|
COPY . /app
|
||||||
COPY . .
|
|
||||||
|
|
||||||
# Clean install all node modules
|
RUN cd /app && yarn install && yarn build
|
||||||
RUN npm ci
|
|
||||||
|
|
||||||
# Build SvelteKit app
|
FROM node:18-alpine
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
# Delete source code files that were used to build the app that are no longer needed
|
RUN mkdir /app
|
||||||
RUN rm -rf src/ static/ emailTemplates/ docker-compose.yml
|
|
||||||
|
|
||||||
# The USER instruction sets the user name to use as the default user for the remainder of the current stage
|
COPY --from=builder /app/build /app/build
|
||||||
USER node:node
|
COPY --from=builder /app/package.json /app/yarn.lock /app/
|
||||||
|
|
||||||
|
RUN cd /app && \
|
||||||
|
yarn install --production &&\
|
||||||
|
yarn cache clean
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
# This is the command that will be run inside the image when you tell Docker to start the container
|
|
||||||
CMD ["node", "build/index.js"]
|
CMD ["node", "build/index.js"]
|
3911
package-lock.json
generated
3911
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user